package com.carpedil.shirodemo.common.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;

/** @author Administrator */
public class MybatisPlusConfig {
  /** 分页插件 */
  //    @Bean
  //    public PaginationInnerInterceptor paginationInterceptor() {
  //        PaginationInnerInterceptor paginationInnerInterceptor = new
  // PaginationInnerInterceptor();
  //        paginationInnerInterceptor.setDbType(DbType.MYSQL);
  //        return paginationInnerInterceptor;
  //    }

  @Bean
  public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    return interceptor;
  }

  //    @Bean
  //    public ConfigurationCustomizer configurationCustomizer() {
  //        return configuration -> configuration.setUseDeprecatedExecutor(false);
  //    }
}
